package com.samehope.ar.mapper;

import com.samehope.ar.entity.Project;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.samehope.ar.vo.UserProjectDataVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 项目 Mapper 接口
 * </p>
 *
 * @author Zhang Luo
 * @since 2019-12-23
 */
public interface ProjectMapper extends BaseMapper<Project> {

    /**
     * 根据企业和项目名称查找企业
     * @param companyId
     * @param projectName
     * @return
     */
    Project findByCompanyAndProjectName(@Param("companyId") Long companyId,
                                        @Param("projectName") String projectName,
                                        @Param("projectId") Long projectId);

    /**
     * 根据用户、企业查找项目及其角色
     * @param companyId
     * @param userId
     * @return
     */
    List<UserProjectDataVO> findByCompany(@Param("companyId") Long companyId, @Param("userId") Long userId);
}
